.swiper-box {
  width: 100%;
  height: 405px;

  margin-top: 10px;
  display: flex;
  gap: 15px;
  position: relative; /* 添加相对定位 */
  overflow: hidden; /* 隐藏溢出内容 */

  .swiper-wrapper {
    display: flex;
    gap: 15px;
    transition: transform 0.5s ease; /* 添加滑动动画 */
  }
  //作品轮播图
  .swiper-item {
    width: 240px;
    height: 100%;
    box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1); // 添加阴影增强效果
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0; /* 防止项目缩小 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;

    &:hover {
      transform: translateY(-5px); // 向上移动
      box-shadow: 0 0px 10px 0px rgba(0, 0, 0, 0.1); // 添加阴影增强效果
      z-index: 2; // 确保悬停项在上层

      .swiper-img {
        .image-hover-layer {
          opacity: 1; // 显示蒙层
        }

        .dot-menu,
        .preview-icon {
          opacity: 1; // 显示操作图标
        }
      }

      .swiper-memories {
        .stat-item span:first-child {
          opacity: 1; // 显示图标
        }
      }
    }
    .swiper-img {
      width: 100%;
      height: 70%;

      position: relative;
      .image-hover-layer {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        transition: opacity 0.3s ease;
        z-index: 1;
      }

      .dot-menu,
      .preview-icon {
        position: absolute;
        z-index: 2;
        opacity: 0;
        transition: opacity 0.3s ease;
      }

      .dot-menu {
        top: 20px;
        right: 10px;
        background: #999999;
        height: 20px;
        line-height: 20px;
        border-radius: 5px;
        color: white;
        font-size: 20px;
        font-weight: bold;
        cursor: pointer;
        // position: relative;
        z-index: 100;
      }

      .hover-content {
        position: absolute;
        top: 30px; // 在图标下方显示
        right: 0px;
        background: white;
        border-radius: 4px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        width: 120px;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none; // 防止未显示时挡住交互
        z-index: 1000; // 确保在最上层
        transition: opacity 0.3s ease;
        &.visible {
          opacity: 1;
          pointer-events: auto;
        }
        div {
          padding: 8px 12px;
          font-size: 12px;
          color: #000;
          font-weight: normal;
          cursor: pointer;

          &:hover {
            background: #f5f5f5;
          }
        }
      }
      .dot-menu:hover {
        color: #1d68ff;
        background: #fff;
      }

      // 鼠标悬停在dot-menu上时显示操作菜单
      .dot-menu:hover .hover-content {
        opacity: 1;
        pointer-events: auto;
      }

      .preview-icon {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        border: 1px solid #fff;
        border-radius: 20px;
        width: 120px;
        height: 40px;
        display: flex;
        align-items: center;
        color: #fff;
        justify-content: center;
        cursor: pointer;

        svg {
          fill: #333;
        }
      }

      .preview-icon:hover {
        background: #1d68ff;
        border: none;
      }

      .no-publish {
        width: 60px;
        height: 30px;
        line-height: 30px;
        text-align: center;
        position: absolute;
        color: #fff;
        font-size: 14px;
        background: #999999;
      }

      img {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
    }

    .swiper-text {
      position: relative; // 添加相对定位
      width: 100%;
      height: 30%;
      font-size: 12px;
      padding: 10px; // 添加内边距
      background: #fff;
      .default-content {
        display: block; // 默认显示
        transition: opacity 0.3s ease;

        .swiper-form {
          display: inline-block;
          width: 40px;
          height: 20px;
          text-align: center;
          line-height: 20px;
          color: #3bb7c8;
          background: #ecf6f9;
          border-radius: 5px;
          margin-bottom: 8px;
        }

        h5 {
          font-size: 14px;
          margin: 4px 0;
          color: #333;
          font-weight: bold;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
        }

        time {
          color: #ababab;
          display: block;
          margin-bottom: 8px;
        }
      }
      .swiper-memories {
        color: #ababab;
        display: flex;
        gap: 10px;
        align-items: center;

        p {
          margin: 0;
          span {
            color: #1d68ff;
          }
        }
      }

      .hover-icons {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 80%;
        background: white;
        padding: 15px 0;

        justify-content: space-around;

        align-items: center;
        border-radius: 8px;
        .hover-icons-box {
          display: flex;
          gap: 20px;
          align-items: center;
        }
        .icon-item {
          display: flex;
          justify-content: space-around;
          align-items: center;

          cursor: pointer;
          transition: color 0.3s;

          .anticon {
            font-size: 20px;
            margin-bottom: 5px;
            color: #666;
          }

          span {
            font-size: 12px;
            color: #666;
          }

          &:hover {
            .anticon,
            span {
              color: #1d68ff;
            }
          }
        }
      }
    }

    // 鼠标悬停时显示hover-text
    &:hover {
      .swiper-text {
        .default-content {
          opacity: 0;
        }

        .hover-text {
          opacity: 1;
        }
      }
    }
    // 鼠标悬停时切换显示
    &:hover {
      .swiper-text {
        .default-content {
          opacity: 0;
          pointer-events: none;
        }

        .hover-icons {
          display: flex;
        }
      }
    }
  }

  //精选模版
  .seleted-item {
    cursor: pointer;
    width: 240px;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0; /* 防止项目缩小 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;

    &:hover {
      transform: translateY(-5px); // 向上移动
      box-shadow: 0 0px 10px 0px rgba(0, 0, 0, 0.1); // 添加阴影增强效果
      z-index: 2; // 确保悬停项在上层

      .swiper-img {
        .image-hover-layer {
          opacity: 1; // 显示蒙层
        }

        .dot-menu,
        .preview-icon {
          opacity: 1; // 显示操作图标
        }
      }

      .swiper-memories {
        .stat-item span:first-child {
          opacity: 1; // 显示图标
        }
      }
    }
    .swiper-img {
      width: 100%;
      height: 70%;

      position: relative;
      .image-hover-layer {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        transition: opacity 0.3s ease;
        z-index: 1;
      }

      .h5 {
        width: 40px;
        height: 20px;
        line-height: 20px;
        text-align: center;
        position: absolute;
        border-radius: 5px;
        bottom: 2px;
        left: 3px;
        color: #fff;
        font-size: 14px;
        background: rgba(0, 0, 0, 0.6);
      }

      img {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
    }

    .swiper-text {
      position: relative;
      width: 100%;
      height: 30%;
      font-size: 12px;
      padding: 10px;
      background: #fff;

      .default-content {
        transition: opacity 0.3s ease;
      }

      .hover-text {
        position: absolute;
        top: 20px;
        left: 0;

        padding: 10px;
        display: flex;
        gap: 40px;
        align-items: center;

        opacity: 0;
        transition: opacity 0.3s ease;

        .hover-img {
          display: flex;
          align-items: center;
          gap: 8px;

          img {
            width: 20px;
            height: 20px;
            border-radius: 50%;
          }
        }
      }
    }

    // 鼠标悬停时显示hover-text
    &:hover {
      .swiper-text {
        .default-content {
          opacity: 0;
        }

        .hover-text {
          opacity: 1;
        }
      }
    }
  }

  /* 箭头样式 */
  .swiper-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: #fff;
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: opacity 0.3s;

    &:hover {
      font-weight: bold;
      background: #1d68ff;
      color: #fff;
    }

    &.left {
      left: 0px;
    }

    &.right {
      right: 0px;
    }

    /* 隐藏箭头 */
    &.hidden {
      display: none;
    }
  }
}

.loading,
.error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 20px;
}
